package com.lovebaby.lcy.dao;

import com.lovebaby.lcy.BaseTest;
import com.lovebaby.lcy.entity.Appointment;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

public class AppointmentDaoTest extends BaseTest {
    @Autowired
    private AppointmentDao appointmentDao;

    @Test
    public void testInsertAppointment() throws Exception{
        long bookId = 1000;
        long studentId = 1234567890L;
        int insert = appointmentDao.insertAppointment(bookId,studentId);
        System.out.println("insert=" + insert);
    }
    @Test
    public void testQueryByKeyWithBook() throws Exception{
        long bookId = 1000;
        long student = 1234567890L;
        Appointment appointment = appointmentDao.queryByKeyWithBook(bookId,student);
        System.out.println(appointment);
        System.out.println(appointment.getBook());
    }
}
